import api from '../../api';
import { message } from 'antd';

export default {
  namespace: 'tradeDateM',
  state: {},
  effects: {
    //获取前一交易日
    *getTradingDate({ payload, callback }, { call, put }) {
      const res = yield call(api.getTradingDate, payload);
      if (res && res.message == 'success') {
        callback(res.data);
      } else {
        message.error(res?.message);
      }
    },
  },

  reducers: {
    save(state, { payload }) {
      return { ...state, ...payload };
    },
  },
};
